<?php

use \app\assets\BackendAsset as Asset;
use \app\models\tableModel\AdminRoleModel;

/* @var $this yii\web\View */
/* @var $model app\models\tableModel\PositionDataModel */

?>
<el-main class="content-wrapper no-pl no-pr no-border bg-gray">
    <el-form :model="form" :rules="formRules" ref="ruleForm" label-width="140px"
             class="form-400" label-position="left" :validate-on-rule-change="false">

        <el-card shadow="hover">
            <el-form-item label="主表编号" prop="pos_id" class="form-item" :inline-message="true"
                    :error="customErrMsg.pos_id" ref="formItem_pos_id">

                <el-input v-model="form.pos_id" size="small" class="form-element"
                        placeholder="请输入主表编号" type="string">
                </el-input>

                <div class="form-element-append-inline" style="display: none;">
                    <el-tooltip class="item" effect="light"
                                placement="top-start">
                        <div slot="content">
                            行内说明内容
                        </div>
                        <div>
                            <i class="el-icon-question font-second pointer"></i>
                            <span class="font-third">
                            什么是行内说明？
                        </span>
                        </div>
                    </el-tooltip>
                </div>
                <div class="form-element-append lh-normal mt-5" style="display: none;">
                    <i class="el-icon-question font-second"></i>
                    <span class="font-third">
                        非行内说明文本
                    </span>
                </div>

            </el-form-item>
        </el-card>

        <el-card shadow="hover">
            <el-form-item label="来源编号" prop="from_id" class="form-item" :inline-message="true"
                    :error="customErrMsg.from_id" ref="formItem_from_id">

                <el-input v-model="form.from_id" size="small" class="form-element"
                        placeholder="请输入来源编号" type="string">
                </el-input>

                <div class="form-element-append-inline" style="display: none;">
                    <el-tooltip class="item" effect="light"
                                placement="top-start">
                        <div slot="content">
                            行内说明内容
                        </div>
                        <div>
                            <i class="el-icon-question font-second pointer"></i>
                            <span class="font-third">
                            什么是行内说明？
                        </span>
                        </div>
                    </el-tooltip>
                </div>
                <div class="form-element-append lh-normal mt-5" style="display: none;">
                    <i class="el-icon-question font-second"></i>
                    <span class="font-third">
                        非行内说明文本
                    </span>
                </div>

            </el-form-item>
        </el-card>

        <el-card shadow="hover">
            <el-form-item label="数据" prop="data" class="form-item" :inline-message="true"
                    :error="customErrMsg.data" ref="formItem_data">

                <el-input v-model="form.data" size="small" class="form-element"
                        placeholder="请输入数据" type="string">
                </el-input>

                <div class="form-element-append-inline" style="display: none;">
                    <el-tooltip class="item" effect="light"
                                placement="top-start">
                        <div slot="content">
                            行内说明内容
                        </div>
                        <div>
                            <i class="el-icon-question font-second pointer"></i>
                            <span class="font-third">
                            什么是行内说明？
                        </span>
                        </div>
                    </el-tooltip>
                </div>
                <div class="form-element-append lh-normal mt-5" style="display: none;">
                    <i class="el-icon-question font-second"></i>
                    <span class="font-third">
                        非行内说明文本
                    </span>
                </div>

            </el-form-item>
        </el-card>

        <el-card shadow="hover">
            <el-form-item label="来源类型" prop="from_type" class="form-item" :inline-message="true"
                    :error="customErrMsg.from_type" ref="formItem_from_type">

                <el-radio-group v-model="form.from_type + ''" size="mini" class="form-element">

                    <el-radio v-for="item in setting.from_type_text_list"
                        :label="item.value">
                        {{item.text}}
                    </el-radio>

                </el-radio-group>

                <div class="form-element-append-inline" style="display: none;">
                    <el-tooltip class="item" effect="light"
                                placement="top-start">
                        <div slot="content">
                            行内说明内容
                        </div>
                        <div>
                            <i class="el-icon-question font-second pointer"></i>
                            <span class="font-third">
                            什么是行内说明？
                        </span>
                        </div>
                    </el-tooltip>
                </div>
                <div class="form-element-append lh-normal mt-5" style="display: none;">
                    <i class="el-icon-question font-second"></i>
                    <span class="font-third">
                        非行内说明文本
                    </span>
                </div>

            </el-form-item>
        </el-card>

        <el-card shadow="hover">
            <el-form-item label="排序" prop="sort" class="form-item" :inline-message="true"
                    :error="customErrMsg.sort" ref="formItem_sort">

                <el-input v-model="form.sort" size="small" class="form-element"
                        placeholder="请输入排序" type="number">
                </el-input>

                <div class="form-element-append-inline" style="display: none;">
                    <el-tooltip class="item" effect="light"
                                placement="top-start">
                        <div slot="content">
                            行内说明内容
                        </div>
                        <div>
                            <i class="el-icon-question font-second pointer"></i>
                            <span class="font-third">
                            什么是行内说明？
                        </span>
                        </div>
                    </el-tooltip>
                </div>
                <div class="form-element-append lh-normal mt-5" style="display: none;">
                    <i class="el-icon-question font-second"></i>
                    <span class="font-third">
                        非行内说明文本
                    </span>
                </div>

            </el-form-item>
        </el-card>

        <el-card shadow="hover">
            <el-form-item label="添加时间" prop="add_time" class="form-item" :inline-message="true"
                    :error="customErrMsg.add_time" ref="formItem_add_time">

                <el-input v-model="form.add_time" size="small" class="form-element"
                        placeholder="请输入添加时间" type="number">
                </el-input>

                <div class="form-element-append-inline" style="display: none;">
                    <el-tooltip class="item" effect="light"
                                placement="top-start">
                        <div slot="content">
                            行内说明内容
                        </div>
                        <div>
                            <i class="el-icon-question font-second pointer"></i>
                            <span class="font-third">
                            什么是行内说明？
                        </span>
                        </div>
                    </el-tooltip>
                </div>
                <div class="form-element-append lh-normal mt-5" style="display: none;">
                    <i class="el-icon-question font-second"></i>
                    <span class="font-third">
                        非行内说明文本
                    </span>
                </div>

            </el-form-item>
        </el-card>

        <el-card shadow="hover">
            <el-form-item label="更新时间" prop="update_time" class="form-item" :inline-message="true"
                    :error="customErrMsg.update_time" ref="formItem_update_time">

                <el-input v-model="form.update_time" size="small" class="form-element"
                        placeholder="请输入更新时间" type="number">
                </el-input>

                <div class="form-element-append-inline" style="display: none;">
                    <el-tooltip class="item" effect="light"
                                placement="top-start">
                        <div slot="content">
                            行内说明内容
                        </div>
                        <div>
                            <i class="el-icon-question font-second pointer"></i>
                            <span class="font-third">
                            什么是行内说明？
                        </span>
                        </div>
                    </el-tooltip>
                </div>
                <div class="form-element-append lh-normal mt-5" style="display: none;">
                    <i class="el-icon-question font-second"></i>
                    <span class="font-third">
                        非行内说明文本
                    </span>
                </div>

            </el-form-item>
        </el-card>

    </el-form>
    <div class="form-bottom-free"></div>
</el-main>

<el-footer class="bottom-button" :height="50">
    <el-button size="mini" type="danger" @click="cancel" v-show="pageDialog.isIframe">
        取消
    </el-button>
    <?php if (AdminRoleModel::checkAuth('create')) { ?>
    <el-button size="mini" type="success" @click="submit" v-if="setting.isCreate === true">
        创建
    </el-button>
    <?php } ?>
    <?php if (AdminRoleModel::checkAuth('update')) { ?>
    <el-button size="mini" type="primary" @click="submit" v-if="setting.isCreate === false">
        保存
    </el-button>
    <?php } ?>
</el-footer>

<?php
Asset::addCss($this, '/css/backend/position-data-form.css');
Asset::addScript($this, '/js/backend/position-data-form.js');

$isCreate = !isset($isCreate) || !$isCreate ? 'false' : 'true'; // 是否新建
$this->registerJs('instance = new app(' . $isCreate . ');');
?>
